import {FADepartment, HRDepartment} from './Departments';
import {Employee, FullTimeEmployee, PartTimeEmployee} from './Employees';

import separate from '../patternSeparator';

separate('模板方法 模式');

let list:Array<Employee> = [];

let staff1 = new FullTimeEmployee('Jame', 400);
let staff2 = new FullTimeEmployee('Lucy', 430);
let staff3 = new PartTimeEmployee('Tom', 6);
let staff4 = new PartTimeEmployee('Cunt', 5);

list.push(staff1);
list.push(staff2);
list.push(staff3);
list.push(staff4);

let faDep = new FADepartment();
let hrDep = new HRDepartment();

list.forEach((employee:Employee)=>{
  employee.accept(hrDep);
});
console.log('-----------------');
list.forEach((employee:Employee)=>{
  employee.accept(faDep);
});
